The format of the text version of the filters format is as follows. For more information on how filters work and what the various entries mean, see the YA-NewsWatcher documentation.
Running the Filter to TEXT application on a valid YA-NewsWatcher filter file will generate a text file in the correct format. Such a file can be used as a sample of how a properly formatted text version of a YA-NewsWatcher filter file should look and be organized.
Any line beginning with a hashmark (#) is considered a comment and is ignored. All other lines are of the form:
SYMBOL=value
Note that there is no space on either side of the equals sign. SYMBOL is one of the following:
GROUP
KEPT
STRING
HEADER
MATCH
EXPIRE
IGNORECASE
SCORE
LABEL
NUMBER1
NUMBER2
ENABLE1
ENABLE2
IGNORE0
The meaning of these symbols are described below, along with the permissible values for "value."
For each filter group, the following two symbols must be defined. They should appear in the order shown. If this rule is not obeyed it may not be possible to reconvert the text file back to a valid, complete and accurate filter file. In particular the GROUP token is used to signal that a new filter group is being described, so it must appear before the other symbols used to define settings for a particular group or filter. Also, the STRING token is used to signal that a new individual filter is being described, so it must appear before the other symbols used to define settings for a particular filter.
GROUP
The name of the filter group. This is either the name of a newsgroup (for a local filter), the name of a newsgroup followed by a period (for a regional filter), or just a single period (for the global filter group).
KEPT
The "Articles Not Matched Are Kept/Killed" value. This can be set equal to either kTrue (unmatched articles are kept) or kFalse (unmatched articles are killed.)
Following these is the listing of the filters in the specified filter group. Each individual filter is defined using the following symbols. Again, they should appear in the order shown. If this rule is not obeyed it may not be possible to reconvert the text file back to a valid, complete and accurate filter file. In particular, the STRING token must appear first, as it is used to signal that a new filter is being described.
STRING
The string used for filter matching. It can be no longer than 255 characters. Everything following the STRING= to the end of the line is considered part of the string. This string is used for most but not all kinds of filters. The exceptions are filtering by date and line count, which ignore the STRING value (and use NUMBER1 ... IGNORE0 instead).
HEADER
The article header used for the filter. The possible values are:
Subject
From
Keywords
Summary
Date
Organization
References
Distribution
Lines
Newsgroups
Path
NNTP-PostingHost
Xref
MATCH
What kind of string matching is done between the HEADER and STRING values. Again, this value is used for most but not all kinds of filters. The exceptions are filtering by date and line count, which ignore the MATCH value. The possible values are:
kWordBeginsWith
kContainsTheString
kWordEndsWith
kPhraseBeginsWith
kContainsTheWord
kPhraseEndsWith
kPhraseExactlyEquals
kRegExp
EXPIRE
The number of days until the filter expires, with 0 meaning never expire (a perpetual filter). The value must be 0 or a positive whole number.
IGNORECASE
The "Ignore Case" value used when matching strings. It is not used when filtering by date or line count. It also is not used when performing regular expression string matching (MATCH=kRegExp).
SCORE
The score, or importance weighting factor assigned to the filter. The value must be whole number between -32767 and 32767.
LABEL
The number of the label assigned to the filter. There are 34 possible values, from 0 to 33. The values may NOT be the same as the filter priority, because the labels can be reordered by dragging in YA-NW's prefs dialog. At the top of the converted filter file is a list of all the filter labels (obtained from the YA-NW prefs file that was opened as part of the conversion process). For each label the priority value and descriptive text are shown. The two lowest priority filters can not be reordered by dragging or renamed, so number 32 is always priority 32 (unlabeled) and number 33 is always priority 33 (killed).
The following are only significant when filtering by date or line count, and the meanings of the these items depends on whether the filter is for a date or a line count.
NUMBER1
The value must be 0 or a positive whole number.
NUMBER2
The value must be 0 or a positive whole number.
ENABLE1
Should the value in NUMBER1 be used in the filter? This can be set equal to either kTrue (the number is used) or kFalse (the number is ignored.)
ENABLE2
Should the value in NUMBER2 be used in the filter? This can be set equal to either kTrue (the number is used) or kFalse (the number is ignored.)
IGNORE0
Should zero values (of date or line count, depending on the filter type) be ignored when applying the filter? This can be set equal to either kTrue (zero values are ignored and not labeled by the filter) or kFalse (zero values are given no special treatment.)